import request from "@/utils/request";

// 查询发货通知单头列表
export function listDeliverynotice(query) {
  return request({
    url: "/mes/wm/deliverynotice/list",
    method: "get",
    params: query,
  });
}

// 查询发货通知单头详细
export function getDeliverynotice(id) {
  return request({
    url: "/mes/wm/deliverynotice/" + id,
    method: "get",
  });
}

// 新增发货通知单头
export function addDeliverynotice(data) {
  return request({
    url: "/mes/wm/deliverynotice",
    method: "post",
    data: data,
  });
}

// 修改发货通知单头
export function updateDeliverynotice(data) {
  return request({
    url: "/mes/wm/deliverynotice",
    method: "put",
    data: data,
  });
}

// 根据发货单fid查询产品列表
export function selectListDeliverynotice(id) {
  return request({
    url: "/mes/wm/deliverynotice/selectList/" + id,
    method: "get",
  });
}
export function warehousingDeliverynotice(id, query) {
  return request({
    url: "/mes/wm/deliverynotice/warehousing/" + id,
    method: "get",
    params: query,
  });
}

// 生成销售出库单接口
export function warehousingAdd(data) {
  return request({
    url: "/mes//wm/deliverynotice/warehousing/add",
    method: "post",
    data: data,
  });
}

// 承运商 列表接口
export function selectAll(query) {
  return request({
    url: "/mes/md/vendor/selectAll",
    method: "get",
    params: query,
  });
}

//同步发货通知单
// export function synchronization() {
//   return request({
//     url: "/mes/k3cloud/api/deliverynotice/syncDeliverynoticeList",
//     method: "get",
//   });
// }
export function synchronization() {
  return request({
    url: "/sync/k3cloud/api/syncDeliverynotice/syncDeliverynotice",
    method: "get",
  });
}

//查询发货通知单中的发货请检单
export function getDelivery(fid) {
  return request({
    url: `/mes/wm/deliverynotice/delivery/check/${fid}`,
    method: "get",
  });
}

// 请检单 保存接口
export function submitPlease(data) {
  return request({
    url: "/mes/please/check",
    method: "post",
    data: data,
  });
}

export function inspectionSubmission(data) {
  return request({
    url: "/mes/please/detail/inspectionSubmission",
    method: "post",
    data: data,
  });
}
